<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#box{
				width: 300px;
				height: 200px;
				border: 5px solid black;
				overflow: auto;
			}
			#box-inner{
				width: 300px;
				height: 400px;
				background-color: orangered;
			}
		</style>
	</head>
	<body>
		<div id="box">
			<div id="box-inner">
				
			</div>
		</div>
		<script type="text/javascript">
			var oBox = document.getElementById("box")
			var oBoxinner = document.getElementById("box-inner")
			document.onclick = function  () {
				//在没有滚动的情况下，scrollWidth=clientWidth
				console.log(oBox.scrollWidth)
				
				console.log(oBox.clientWidth)
				
				console.log(oBox.o)
				
				//总结：
				//    出现滚动条，scrollWidth要比offsetWidth和clientWidth大。
				//    offsetWidth和clientWidth的区别：offsetWidth计算了边框
			}
		</script>
	</body>
</html>
